<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>会员管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        function page(n, s) {
            if (n) $("#pageCurrent").val(n);
            if (s) $("#pageSize").val(s);
            $("#searchForm").attr("action", "${ctx}/sys/sysUser/wechatList");
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/sysUser/wechatList">${userTypeDictItem.itemName}列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="sysUser"  method="post" class="breadcrumb form-search ">
    <input id="pageCurrent" name="pageCurrent" type="hidden" value="${page.current}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.size}"/>
    <ul class="ul-form">
        <li>
            <label>昵称：</label>
            <form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>登录名：</label>
            <form:input path="loginName" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li>
            <label>手机号：</label>
            <form:input path="mobile" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li class="btns">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>微信ID</th>
        <th>昵称</th>
        <th>头像</th>
        <th>会员等级</th>
        <th>备注</th>
        <shiro:hasPermission name="sys:sysUser:edit">
            <th>操作</th>
        </shiro:hasPermission></tr>
    </thead>
    <tbody>
    <c:forEach items="${page.records}" var="user">
        <tr>
            <td width="25%">${user.wechatOpenid}</td>
            <td>${user.name}</td>
            <td><img src="${user.photo}" style="max-width:30px;max-height:30px;_height:30px;border:0;padding:1px;"></td>
            <td>${fns:getDataDictValue( 'member_level',user.memberLevel)}</td>
            <td>${user.remarks}</td>
            <shiro:hasPermission name="sys:sysUser:edit">
                <td>
                    <a href="${ctx}/sys/sysUser/wechatForm?id=${user.id}">修改</a>
                    &nbsp;
                    <c:if test="${user.loginFlag == 'Y'}">
                        <a href="${ctx}/sys/sysUser/denyWechatLogin?userId=${user.id}" onclick="return confirmx('确定要将该会员加入黑名单吗？', this.href)">拉黑</a>
                    </c:if>
                    <c:if test="${user.loginFlag == 'N'}">
                        <a href="${ctx}/sys/sysUser/allowWechatLogin?userId=${user.id}" onclick="return confirmx('确定要将该会员移出黑名单吗？', this.href)">移出</a>
                    </c:if>

                </td>
            </shiro:hasPermission>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>